﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DBSubjectEdit.ascx.cs" Inherits="ExaminationSys.View.SystemManage.DBSubjectEdit" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script type="text/javascript" language="javascript">
    var setID = function (param) {
        try {

            var hidden = document.getElementById('<%=DBSubjectIDHidden.ClientID %>');
            hidden.value = param;
        } catch (e) {
            alert(e);
        }
    };
    var lock = function (param) {
        try {

            var hidden = document.getElementById('<%=LockHidden.ClientID %>');
            hidden.value = param;
        } catch (e) {
            alert(e);
        }
    };
    var serialNo = function (param) {
        try {

            var hidden = document.getElementById('<%=txtSerialNo.ClientID %>');
            hidden.value = param;
        } catch (e) {
            alert(e);
        }
    };
    var attachFile = function (param) {
        try {

            var hidden = document.getElementById('<%=txtAttachFile.ClientID %>');
            hidden.value = param;
        } catch (e) {
            alert(e);
        }
    };
</script>
<style type="text/css">
   .lbl{text-align:right;}
   .chk{ text-align:left; margin: 2px 0 0 10px;}
</style>

<input type="hidden" id="DBSubjectIDHidden" runat="server" />
<input type="hidden" id="LockHidden" value="0" runat="server" />
<input type="hidden" ID="txtSerialNo" runat="server" />
<input type="hidden" ID="txtAttachFile" runat="server" />
<ext:Window 
    ID="DBSubjectEditWindow" 
    runat="server"
    Icon="Group" 
    Title="题库管理(大题)编辑"
    Width="750" 
    Height="430"
    AutoShow="false" 
    Modal="true" 
    Hidden="true"
    Layout="Fit">
    <Items> 
        <ext:FormPanel 
            ID="DBSubjectEditPanel" 
            runat="server" 
            Icon="ChartOrganisation"
            DefaultAnchor="95%"
            Padding="5"
            BodyPadding="10"
            MonitorPoll="500" 
            MonitorValid="true" 
            Width="600" 
            Height="250"
            ButtonAlign="Center"
            Layout="Column">
            <Items>               
                <ext:Panel ID="Panel1" runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form" LabelAlign="Top">
                    <Defaults>
                        <ext:Parameter Name="MsgTarget" Value="side" />
                    </Defaults>
                    <Items>
                        <ext:TextField ID="Title" runat="server" AllowBlank="false" FieldLabel="标题" Cls="lbl" AnchorHorizontal="92%" />
                        <ext:TextField ID="Knowledge" runat="server"  FieldLabel="知识点" Cls="lbl" AnchorHorizontal="92%" />
                        <ext:TextField ID="KeyWord" runat="server"  FieldLabel="关键字" Cls="lbl" AnchorHorizontal="92%" />
                    </Items>
                </ext:Panel>
                <ext:Panel ID="Panel2" runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form" LabelAlign="Top">
                    <Defaults>
                        <ext:Parameter Name="AllowBlank" Value="false" Mode="Raw" />
                        <ext:Parameter Name="MsgTarget" Value="side" />
                    </Defaults>
                    <Items>
                        <ext:ComboBox ID="Stage" runat="server" FieldLabel="阶段" Cls="lbl" Editable="false" EmptyText="请选择阶段">
                            <Items>
                                <ext:ListItem Value="高级" Text="高级"></ext:ListItem>
                                <ext:ListItem Value="中级" Text="中级"></ext:ListItem>
                                <ext:ListItem Value="初级" Text="初级"></ext:ListItem>
                            </Items>
                        </ext:ComboBox>
                        <ext:ComboBox ID="Challenge" runat="server" FieldLabel="难度" Cls="lbl" Editable="false" EmptyText="请选择难度">
                            <Items>
                                <ext:ListItem Value="高" Text="高"></ext:ListItem>
                                <ext:ListItem Value="中" Text="中"></ext:ListItem>
                                <ext:ListItem Value="低" Text="低"></ext:ListItem>
                            </Items>
                        </ext:ComboBox>
                        <ext:ComboBox ID="SubjectType" runat="server" FieldLabel="题型" Cls="lbl" Editable="false" EmptyText="请选择题型">
                            <Items>
                                <ext:ListItem Value="阅读" Text="阅读" Index="0"></ext:ListItem>
                                <ext:ListItem Value="视听" Text="视听"></ext:ListItem>
                            </Items>
                        </ext:ComboBox>
                    </Items>
                </ext:Panel>
                <ext:Panel ID="Panel4" runat="server" Border="false" Header="false" ColumnWidth="1" Layout="Form" LabelAlign="Top">
                    <Items>
                        <ext:FileUploadField 
                            ID="AttachFile" 
                            runat="server" 
                            EmptyText="Select an File"
                            FieldLabel="附件" Cls="lbl"
                            ButtonText="请选择文件"
                            IndicatorText="*视听题请上传多媒体文件"
                            Icon="Attach"
                            />
                    </Items>
                </ext:Panel>
                <ext:Panel ID="Panel5" runat="server" Border="false" Header="false" ColumnWidth="1" Layout="Form" LabelAlign="Top">
                    <Items>
                        <ext:HtmlEditor ID="Content" FieldLabel="内容" runat="server" Cls="lbl" Border="true" AutoScroll="true" Height="180" />
                    </Items>
                </ext:Panel>
                <ext:Panel ID="Panel17" runat="server" Border="false" Header="false" ColumnWidth=".18"  Layout="Form">
                    <Items>
                        <ext:Checkbox ID="chkLock" runat="server" Cls="lbl" FieldLabel="锁定" Width="100" Margins="0 0 0 5"></ext:Checkbox>                        
                    </Items>
                </ext:Panel>
            </Items>
            <Buttons>                
                <ext:Button ID="SaveButton" runat="server" Text="保存" Icon="BulletGo">
                    <DirectEvents>
                        <Click OnEvent="SaveDBSubject" Failure="Ext.MessageBox.alert('Saving failed', 'Error during ajax event');">
                        </Click>
                    </DirectEvents>            
                </ext:Button>               
                <ext:Button ID="Button1" runat="server" Text="保存并转到小题" Icon="BulletGo">
                    <DirectEvents>
                        <Click OnEvent="SaveDBSubjectAndSubQuestion" Failure="Ext.MessageBox.alert('Go failed', 'Error during ajax event');">
                        </Click>
                    </DirectEvents>            
                </ext:Button>
                <ext:Button ID="CancelButton" runat="server" Text="取消" Icon="Cancel">
                    <Listeners>
                         <Click Handler="#{DBSubjectEditWindow}.hide(null);" />
                    </Listeners>
                </ext:Button>
            </Buttons>
        </ext:FormPanel>      
    </Items>
</ext:Window>